home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 2.5 KB | 87 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: PaletteFacet.h
- // Release Version: $ 1.0d1 $
- //
- // Author: Henri Lamiraux
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef PALETTEFACET_H
- #define PALETTEFACET_H
-
- #ifndef DRAWPART_H
- #include "DrawPart.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWFACET_H
- #include "FWFacet.h"
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
- #include <QuickDraw.h>
- #endif
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- //==============================================================================
- // Forward Declaration
- //==============================================================================
-
- class CDrawPart;
- class FW_CGraphicContext;
- class FW_CColor;
-
- //==============================================================================
- // CPaletteFacet
- //==============================================================================
-
- class CPaletteFacet : public FW_CFacet
- {
- //------------------------------------------------------------------------------
- // Initialization/destruction
- //------------------------------------------------------------------------------
- public:
- CPaletteFacet();
- void InitPaletteFacet(XMPFacet* facet, CDrawPart* drawPart);
- virtual ~CPaletteFacet();
-
- //------------------------------------------------------------------------------
- // Inherited
- //------------------------------------------------------------------------------
- public:
- virtual void Draw(FW_CGraphicContext *gc);
-
- virtual FW_Boolean DoMouseDown(const FW_CPoint& where,
- XMPEventData event);
-
- //------------------------------------------------------------------------------
- // New API
- //------------------------------------------------------------------------------
- private:
- void GetColor(short colorIndex, FW_CColor* color) const;
- short CalcIndex(const FW_CPoint& where) const;
-
- //------------------------------------------------------------------------------
- // Data
- //------------------------------------------------------------------------------
- private:
- CDrawPart* fDrawPart;
- CTabHandle fColorTable;
- };
- #endif